//
// Created by mac on 1/24/22.
//
#include <iostream>
#include <vector>


using namespace std;


vector<int> getRow(int rowIndex) {
     vector<int> preRow;

    for (int row = 0; row <=rowIndex; ++row) {
        vector<int> oneRow;
        for (int col = 0; col <= row; ++col) {
            if(col==0 || col==row){
                oneRow.push_back(1);
            }else{
                oneRow.push_back(preRow[col-1]+preRow[col]);
            }
        }
        preRow = oneRow;
    }
    return preRow;
}
